go/types.Checker.error (method)

73 uses

	go/types (current package)
		assignments.go#L81: 			check.error(x, code, msg)
		builtins.go#L527: 			check.error(argList[1], SwappedMakeArgs, invalidArg+"length and capacity swapped")
		call.go#L858: 			check.error(e, InvalidDeclCycle, "illegal cycle in method declaration")
		check.go#L357: 				check.error(file.Name, BlankPkgName, "invalid package name _")
		const.go#L29: 		check.error(atPos(opPos), InvalidConstVal, "constant result is not representable")
		decl.go#L588: 					check.error(tdecl, UnsupportedFeature, "generic type alias requires GOEXPERIMENT=aliastypeparams")
		decl.go#L609: 				check.error(tdecl, UnsupportedFeature, "generic type alias requires GODEBUG=gotypesalias=1 or unset")
		decl.go#L651: 		check.error(tdecl.Type, MisplacedTypeParam, "cannot use a type parameter as RHS in type declaration")
		decl.go#L698: 				check.error(f.Type, MisplacedTypeParam, "cannot use a type parameter as constraint")
		errors.go#L234: func (check *Checker) error(at positioner, code Code, msg string) {
		expr.go#L176: 			check.error(e, UndefinedOp, "cannot use ~ outside of interface or type constraint")
		expr.go#L180: 		check.error(e, UndefinedOp, "cannot use ~ outside of interface or type constraint (use ^ for bitwise complement)")
		expr.go#L809: 			check.error(&y, DivByZero, invalidOp+"division by zero")
		expr.go#L819: 				check.error(&y, DivByZero, invalidOp+"division by zero")
		expr.go#L1011: 		check.error(e, BadDotDotDotSyntax, "invalid use of '...'")
		expr.go#L1068: 			check.error(e, BadTypeKeyword, "use of .(type) outside type switch")
		expr.go#L1137: 		check.error(e, InvalidSyntaxTree, "no key:value expected")
		index.go#L233: 				check.error(at, InvalidSliceExpr, invalidOp+"3-index slice of string")
		index.go#L280: 		check.error(inNode(e, e.Rbrack), InvalidSyntaxTree, "2nd and 3rd index required in 3-index slice")
		index.go#L340: 		check.error(expr.indices[1], InvalidIndex, invalidOp+"more than one index")
		instantiate.go#L204: 		check.error(atPos(pos), WrongTypeArgCount, msg)
		interface.go#L178: 			check.error(name, BlankIfaceMethod, "methods must have a unique non-blank name")
		interface.go#L197: 			check.error(at, InvalidSyntaxTree, "methods cannot have type parameters")
		literals.go#L143: 		check.error(e, UntypedLit, "missing type in composite literal")
		literals.go#L154: 			check.error(e, InvalidTypeCycle, "invalid recursive type")
		literals.go#L171: 					check.error(e, MixedStructLit, "mixture of field:value and value elements in struct literal")
		literals.go#L189: 					check.error(kv.Key, MissingLitField, msg)
		literals.go#L207: 					check.error(kv, MixedStructLit, "mixture of field:value and value elements in struct literal")
		literals.go#L235: 			check.error(e, InvalidTypeCycle, "invalid recursive type")
		literals.go#L263: 			check.error(e, InvalidTypeCycle, "invalid recursive type")
		literals.go#L273: 			check.error(e, InvalidTypeCycle, "invalid recursive type")
		literals.go#L285: 				check.error(e, MissingLitKey, "missing key in map literal")
		resolver.go#L67: 			check.error(s, code, "missing type or init expr")
		resolver.go#L111: 		check.error(ident, InvalidInitDecl, "cannot declare init - must be func")
		resolver.go#L118: 		check.error(ident, InvalidMainDecl, "cannot declare main - must be func")
		resolver.go#L151: 			check.error(at, BadImportPath, "cannot use FakeImportC and go115UsesCgo together")
		resolver.go#L285: 						check.error(d.spec.Name, ImportCRenamed, `cannot rename import "C"`)
		resolver.go#L291: 					check.error(d.spec, InvalidInitDecl, "cannot import package as init - init must be a func")
		resolver.go#L407: 						check.error(d.decl.Recv, BadRecv, "method has no receiver")
		resolver.go#L535: 					check.error(ix.orig, InvalidSyntaxTree, "parameterized receiver contains nil parameters")
		signature.go#L121: 			check.error(recvPar.List[n-1], InvalidRecv, "method has multiple receivers")
		signature.go#L135: 			check.error(ftyp.TypeParams, InvalidMethodTypeParams, "methods cannot have type parameters")
		signature.go#L281: 			check.error(rparam.Names[n-1], InvalidRecv, "method has multiple receivers")
		signature.go#L378: 					check.error(name, InvalidSyntaxTree, "anonymous parameter")
		signature.go#L398: 		check.error(list, InvalidSyntaxTree, "list contains both named and anonymous parameters")
		stmt.go#L50: 		check.error(atPos(body.Rbrace), MissingReturn, "missing return")
		stmt.go#L141: 			check.error(s, InvalidSyntaxTree, "case/communication clause expected")
		stmt.go#L518: 				check.error(s, InvalidSyntaxTree, "missing lhs in assignment")
		stmt.go#L586: 				check.error(s, MisplacedBreak, "break not in for, switch, or select statement")
		stmt.go#L590: 				check.error(s, MisplacedContinue, "continue not in for statement")
		stmt.go#L603: 				check.error(s, MisplacedFallthrough, msg)
		stmt.go#L623: 			check.error(s.Cond, InvalidCond, "non-boolean condition in if statement")
		stmt.go#L634: 			check.error(s.Else, InvalidSyntaxTree, "invalid else branch in if statement")
		stmt.go#L668: 				check.error(c, InvalidSyntaxTree, "incorrect expression switch case")
		stmt.go#L705: 				check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
		stmt.go#L711: 				check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
		stmt.go#L726: 			check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
		stmt.go#L733: 			check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
		stmt.go#L759: 				check.error(s, InvalidSyntaxTree, "incorrect type switch case")
		stmt.go#L829: 				check.error(clause.Comm, InvalidSelectCase, "select case must be send or receive (possibly with assignment)")
		stmt.go#L851: 				check.error(s.Cond, InvalidCond, "non-boolean condition in for statement")
		stmt.go#L871: 		check.error(s, InvalidSyntaxTree, "invalid statement")
		stmt.go#L982: 			check.error(noNewVarPos, NoNewVar, "no new variables on left side of :=")
		struct.go#L156: 						check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be unsafe.Pointer")
		struct.go#L159: 					check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be a pointer")
		struct.go#L165: 						check.error(embeddedPos, MisplacedTypeParam, "embedded field type cannot be a (pointer to a) type parameter")
		struct.go#L169: 						check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be a pointer to an interface")
		typexpr.go#L29: 			check.error(e, InvalidBlank, "cannot use _ as value or type")
		typexpr.go#L100: 				check.error(e, InvalidIota, "cannot use iota outside constant declaration")
		typexpr.go#L313: 			check.error(e.Len, BadDotDotDotSyntax, "invalid use of [...] array (outside a composite literal)")
		typexpr.go#L327: 		check.error(e, InvalidDotDotDot, "invalid use of '...'")
		union.go#L121: 					check.error(tlist[i], InvalidUnion, "cannot use comparable in union")
		union.go#L156: 			check.error(x, MisplacedTypeParam, "term cannot be a type parameter")